package AliDiepPR.ANN.ActivationFunction;

public class HyperbolicTangensFunction implements IActivationFunction {

	float alfa = 1f;

	public HyperbolicTangensFunction() {
	}

	public HyperbolicTangensFunction(float alfa) {
		this.alfa = alfa;
	}

	@Override
	public void Alfa(float alfa) {
		this.alfa = alfa;
	}

	@Override
	public float output(float x) {
		return (float) (Math.tanh(alfa * x));
	}

	@Override
	public float output2(float y) {
		return (float) (alfa * (1 - y * y));
	}

	public String ToString() {
		return "Hyperbolic Tangens Function";
	}
}
